import numpy as np
import matplotlib.pylab as plt

history: dict = np.load("normal.npy", allow_pickle=True)[()]
val_acc = history["val_accuracy"]
train_acc = history["accuracy"]
epochs = range(1, len(val_acc) + 1)
plt.plot(epochs, val_acc, label="val_acc")
plt.plot(epochs, train_acc, label="train_acc")
plt.legend()
plt.xlabel("Epoch")
plt.ylabel("Accuracy")
plt.title("Dense")
plt.savefig("全连接准确率")
plt.show()


history: dict = np.load("translation.npy", allow_pickle=True)[()]
val_acc = history["val_accuracy"]
train_acc = history["accuracy"]
epochs = range(1, len(val_acc) + 1)
plt.plot(epochs, val_acc, label="val_acc")
plt.plot(epochs, train_acc, label="train_acc")
plt.legend()
plt.xlabel("Epoch")
plt.ylabel("Accuracy")
plt.title("Translation")
plt.savefig("Translation准确率")
plt.show()

history: dict = np.load("cnn.npy", allow_pickle=True)[()]
val_acc = history["val_accuracy"]
train_acc = history["accuracy"]
epochs = range(1, len(val_acc) + 1)
plt.plot(epochs, val_acc, label="val_acc")
plt.plot(epochs, train_acc, label="train_acc")
plt.legend()
plt.xlabel("Epoch")
plt.ylabel("Accuracy")
plt.title("CNN")
plt.savefig("CNN准确率")
plt.show()